'''
Created on 16 Apr 2012

@author: karulis
'''

from PySide import QtGui
from BaseTab import BaseTab
from GroupsAddTab import GroupsAddTab
from GroupsRemoveTab import GroupsRemoveTab

class GroupsTab(BaseTab):
    def __init__(self, parent = None):
        super(GroupsTab, self).__init__(parent)

        self.tabWidget = QtGui.QTabWidget()

        self.groupsAddTab = GroupsAddTab()
        self.groupsRemoveTab = GroupsRemoveTab()
        self.groupsAddTab.refresh.connect(self.groupsRemoveTab.refresh_gui)

        self.tabWidget.addTab(self.groupsAddTab, "Add to group")
        self.tabWidget.addTab(self.groupsRemoveTab, "Remove from group")

        mainLayout = QtGui.QVBoxLayout()
        mainLayout.addWidget(self.tabWidget)
        self.setLayout(mainLayout)

    def refresh_gui(self):
        self.groupsAddTab.refresh_gui()
        self.groupsRemoveTab.refresh_gui()
